<nz-card>
  <div class="mb-md">
    <label> 维保任务:
      <input nz-input [(ngModel)]="this.searchBeans[0].attributeValue" name="username" style="width: 150px;"
             class="mr-sm" />
    </label>

    <label> 状态:

      <nz-select nzShowSearch nzAllowClear nzPlaceHolder="请选择任务状态"
                 [(ngModel)]="this.searchBeans[1].attributeValue"
                 style="width: 150px">
        <nz-option nzLabel="全部" nzValue=""></nz-option>
        <nz-option nzLabel="待办理" nzValue="0"></nz-option>
        <nz-option nzLabel="已完成" nzValue="1"></nz-option>
      </nz-select>

    </label>

    <button nz-button (click)="this.loadListData()" [nzType]="'primary'" style="margin-left: 15px">搜索</button>
    <button nz-button (click)="this.clearParam(); this.loadListData()">重置</button>
  </div>

  <nz-table #basicTable [nzData]="deviceGroups" [nzLoading]="loading"
            [nzFrontPagination]="false"
            [nzTotal]="pageData.total"
            [nzPageSize]="pageData.size"
            [nzPageIndex]="pageData.page + 1"
            (nzQueryParams)="onQueryParamsChange($event)" nzBordered nzSize="small">
    <thead>
    <tr>
      <th>任务单号</th>
      <th>所属计划</th>
      <th>设备名称</th>
      <th>责任人</th>
      <th>创建日期</th>
      <th>任务状态</th>
      <th>操作</th>
    </tr>
    </thead>
    <tbody>
    <tr *ngFor="let data of basicTable.data">
      <td>{{data.code}}</td>
      <td>{{data.deviceMaintainPlan?.name}}</td>
      <td>{{data.deviceMaintainPlan?.device?.name}}</td>
      <td>{{data.deviceMaintainPlan?.user?.nickname}}</td>
      <td>{{data.createTime| date:'yyyy-MM-dd HH:mm:ss'}}</td>
      <td>
        <nz-tag
          [nzColor]="data.taskStatus === 1 ? 'success' : 'processing'">
          {{data.taskStatus === 0 ? '待办理' : '已完成' }}</nz-tag>
      </td>
      <td>
        <a nz-button nzType="link" (click)="openEdit(data)"><i nz-icon nzType="edit"></i>办理</a>
        <a nz-button nzType="link" (click)="openView(data)"><i nz-icon nzType="zoom-in"></i>查看</a>
      </td>
    </tr>
    </tbody>
  </nz-table>
</nz-card>

<app-device-maintain-task-edit #deviceMaintainTaskEditComponent
                               (voted)="onSmt()"></app-device-maintain-task-edit>
